package com.jeesite.modules.dataScreen.web;

import com.alibaba.fastjson2.JSONObject;
import com.jeesite.modules.dataScreen.service.AirportInformationService;
import com.jeesite.modules.dataScreen.service.impl.AirportService;
import com.jeesite.modules.dataScreen.web.vo.AirportInformationVo;
import com.jeesite.modules.dataScreen.web.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/airportInformation")
@Api(tags = "民航模块")
public class AirportInformationApi {

    @Resource
    private AirportInformationService airportInformationService;
    @Resource
    private AirportService airportService;

    @GetMapping("/passageDetention")
    @ApiOperation("机场旅客滞留")
    public Result<JSONObject> passageDetention(@RequestParam(defaultValue = "结束") String status) {
        return Result.OK(airportService.passageDetention(status));
    }

    @GetMapping("/retentionProcess")
    @ApiOperation("滞留班次流程")
    public Result<List<JSONObject>> getRetentionProcess(@RequestParam(defaultValue = "1") String eventName) {
        return Result.OK(airportService.getRetentionProcess(eventName));
    }

    @GetMapping("/information")
    @ApiOperation("民航指标数据")
    public Result<AirportInformationVo> information() {
        return Result.OK(airportInformationService.information());
    }


}
